--use PolePosition
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'up_UtilityAssetMeters_SelectForExcel')
	DROP PROCEDURE up_UtilityAssetMeters_SelectForExcel
GO

CREATE PROCEDURE up_UtilityAssetMeters_SelectForExcel
	 @UtilityFk int 
	,@SearchByType varchar(50) = null
	,@SearchByText varchar(50) = null
AS

SET NOCOUNT ON	

SELECT 
 	 Meter.[Utility_Asset_MeterId] AS [Asset]
	,Number AS [Meter Number]
	,Maps.[Name] AS [Map]
	,SectionFk AS [Section]
	,Meter.[Latitude] AS [Latitude]
	,Meter.[Longitude] AS [Longitude]	
from tb_Utility_Asset_Meters Meter
LEFT JOIN tb_Utility_Polygons Maps
	ON Maps.Utility_PolygonId = Meter.[MapFk]
WHERE
	Meter.[UtilityFK] = @UtilityFk


GO

